<?php
// mod文件只能被入口文件引用，不能直接访问
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$topicId = $_G["gp_topicId"];
!isset($topicId) && ( $topicId = 1 );

//获取当前页的留言数据
$list = array();
$sql = "select a.id,t.id as topic_id, t.title as topic_title, a.id as article_id, a.title as article_title, a.summary as article_summary from t_topic t 
        left join t_article a on t.id = a.topic_id 
        where t.id = $topicId order by a.id ";
$query = DB::query($sql);
while($row = DB::fetch($query)) {
	$list[] = $row;
}
DB::free_result($query);

//数据准备完毕，引入相应的模板，准备输出
include_once template("know/viewtopic");

?>